//package net.dopan.pigframe.user.controller;
//
//
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiImplicitParam;
//import io.swagger.annotations.ApiImplicitParams;
//import io.swagger.annotations.ApiOperation;
//import net.dopan.pigframe.api.fegin.OSSServiceApi;
//import net.dopan.pigframe.core.base.controller.BaseController;
//import net.dopan.pigframe.core.base.controller.response.ResponseBean;
//import net.dopan.pigframe.user.mapper.ActivityClassifyMapper;
//import net.dopan.pigframe.user.mapper.UserActivityMapper;
//import net.dopan.pigframe.user.mapper.UserMapper;
//import net.dopan.pigframe.user.model.entity.UserActivity;
//
//import net.dopan.pigframe.user.service.SysUserService;
//
//import org.apache.commons.lang.StringUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestParam;
//import org.springframework.web.bind.annotation.ResponseBody;
//import org.springframework.web.multipart.MultipartFile;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.validation.Valid;
//import java.text.ParseException;
//import java.text.SimpleDateFormat;
//import java.util.Date;
//
//
///**
// * @author wufeihong 发起活动
// */
//@Controller
//@RequestMapping("/userActivity" )
//@Api(tags = "userActivity(API)", description = "发起活动" )
//public class LaunchActivityController extends BaseController {
//
//    @Qualifier("OSSServiceFallback" )
//    @Autowired
//    private OSSServiceApi ossServiceApi;
//    @Autowired
//    private ActivityClassifyService classifyService;
//    @Autowired
//    private HttpServletRequest request;
//    @Autowired
//    private UserActivityService userActivityService;
//    @Autowired
//    private SysUserService sysUserService;
//
//
//    /**
//     * 获取用户身份验证 0未通过 1通过
//     */
//    @RequestMapping("/getIdentityVerification" )
//    @ResponseBody
//    public ResponseBean getIdentityVerification() {
//        String userId = request.getParameter("userId" );
//        int verification = sysUserService.selectById(userId).getIdentityVerification();
//        if (verification != 1) {
//            return new ResponseBean(ResponseBean.FAIL, "请先进行身份验证", "" );
//        }
//        return new ResponseBean(ResponseBean.SUCCESS, "已验证", "" );
//    }
//
//
//    /**
//     * 获取活动类型
//     */
//    @RequestMapping("/getActivityClassify" )
//    @ResponseBody
//    public ResponseBean getActivityClassify() {
//
//        return new ResponseBean<>(ResponseBean.SUCCESS, "", classifyService.selectList());
//    }
//
//    /**
//     * 发起活动
//     */
//    @RequestMapping("/launch" )
//    @ResponseBody
//    @ApiOperation(value = "发起活动", notes = "发起活动" )
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "activityName", value = "活动名称", required = true, dataType = "String" ),
//            @ApiImplicitParam(name = "coverPhotoUrl", value = "背景图片", required = true, dataType = "String" ),
//            @ApiImplicitParam(name = "startTime", value = "开始时间", required = false, dataType = "String" ),
//            @ApiImplicitParam(name = "endTime", value = "结束时间", required = false, dataType = "String" ),
//            @ApiImplicitParam(name = "activityPlace", value = "活动地点", required = false, dataType = "String" ),
//            @ApiImplicitParam(name = "activityDetail", value = "活动详情", required = false, dataType = "String" ),
//            @ApiImplicitParam(name = "classifyId", value = "活动类型", required = true, dataType = "String" ),
//            @ApiImplicitParam(name = "auditing", value = "活动费用", required = false, dataType = "String" ),
//            @ApiImplicitParam(name = "peopleNumber", value = "活动人数", required = false, dataType = "String" )
//    })
//    public ResponseBean launch(@Valid UserActivity userActivity, @RequestParam("file" ) MultipartFile file) {
//
//
//        String overPhotoUrl = ossServiceApi.upload(file).getData();
//        userActivity.setCoverPhotoUrl(overPhotoUrl);
//
//        return new ResponseBean(ResponseBean.SUCCESS, "提交活动成功", userActivityService.addUserActivity(userActivity));
//
//    }
//
//}